<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link rel="stylesheet" type="text/css" href="../General Info/css.css" />
<title>Add Work Package</title>
</head>
<%
if (session.getAttribute("loggedIn") == null) {
	response.sendRedirect("../General Info/index.jsp");
	}
%>
<body>

	<jsp:include page="../General Info/header.jsp"/>
	
	<div class="body">
	<div class="upb">
			<div class="projects">
			<div class="projectsHeader">Create a New Work Package</div>
			</br>
			<form name="addNewMilestoneForm" onsubmit="" method="GET" action="../Milestones/addMilestone.jsp">
				<input type="hidden" name="hProjectId" value=<% out.println(request.getParameter("id")); %>>
				<table>
					<tr>
						<td>Work Package Name:</td>
						<td><input id="milestoneName" class="" type="text" onblur="" name="milestoneName" /></td>
					</tr>
					<tr>
						<td>Work Package Description:</td>
						<td><input id="milestoneDesc" class="" type="text" onblur="" name="milestoneDesc" /></td>
					</tr>
					<tr>
						<td>Start date:</td>
						<td><input id="startDate" class="" type="text" onblur="" name="startDate" /></td>
					</tr>
					<tr>
						<td>End date:</td>
						<td><input id="endDate" class="" type="text" onblur="" name="endDate" /></td>
					</tr>
					<tr>
						<td>Work Package Effort:</td>
						<td><input id="milestoneEffort" class="" type="text" onblur="" name="milestoneEffort" /></td>
					</tr>
					<tr>
						<td>Work Package Estimated Cost:</td>
						<td><input id="estimatedCost" class="" type="text" onblur="" name="estimatedCost" /></td>
					</tr>
					<tr>
						<td>Work Package state:</td>
						<td><select name="milestoneState">
							<option value="1">GRAY</option>
							<option value="2">RED</option>
							<option value="3">GREEN</option>
							<option value="4">YELLOW</option>
							</select></td>
					</tr>
					<tr>
						<td>Work Package State Reason:</td>
						<td><input id="stateReason" class="" type="text" name="stateReason"></td>
					</tr>
					<tr>
						<td></td>
						<td><input type="submit" class="inputButton" value="Create Work Package" /></td>
					</tr>
				</table>
				<%
					if(session.getAttribute("postback")=="true")
					{
						if (session.getAttribute("createMilestone")=="true") { %>
							<div class="successfulChange" id="successfulChange">Status and resolution changed successfully!!</div>
							<%session.setAttribute("createMilestone", null);
							session.setAttribute("postback", null);
						}
						else if(session.getAttribute("createMilestone")=="false") {
							%><div class="notsuccessfulChange" id="notsuccessfulChange">Could not change status and resolution!!!</div>
							<%session.setAttribute("createMilestone", null);
							session.setAttribute("postback", null);
						}
					}
					else{
						%><div class="noChange" id="noChange"></div>	
					<%}%>
			</form>
</div>

</div>
<div class="push"></div>
</div>
		<jsp:include page="../General Info/footer.jsp"/>
</body>
</html>